<div class="clearfix" id="content">
  <div>
    <div class="blogPaneLeft">
      <div class="blogPost">
        <div class="blogUserImage">
          <!-- USER Image -->
        </div>

        <h1 class="blogPostTitle">Articles</h1>
        <div>
        <br style="clear: both;">
        <% if @status == "submitted" %>Pending<% else %><%= link_to "Pending", :action => "showArticleApproval", :status => "submitted" %><%end%>  |
        <% if @status == "rejected" %>Rejected<% else %><%= link_to "Rejected", :action => "showArticleApproval", :status => "rejected" %><%end%>  |
        <% if @status == "approved" %>Approved<% else %><%= link_to "Approved", :action => "showArticleApproval", :status => "approved" %><%end%>  |
        <% if @status == "expired" %>Expired<% else %><%= link_to "Expired", :action => "showArticleApproval", :status => "expired" %><%end%>
        </div>
        <br style="clear: both;">

        <div  height="250px">
            <table width="100%">
            <% if @articles.length > 0%>
                <tr><th>S.No.</th><th>Title</th><th>Author</th><th>Category</th><th>Creation Date</th></tr>
                <% @articles.each_with_index do |a, index| %>
                <tr><td align="center"><%= (index +1)%>.</td><td><%= link_to a.title, :action => "showArticle", :article_id =>  a.article_id %></td><td align="center"><%=h link_to a.author, :controller => :profile, :id => a.user_id %></td><td  align="center"><%=a.categoryname%></td><td  align="center"><%=a.publishdate.to_datetime.strftime('%Y-%m-%d %H:%M:%S')%></td></tr>
                <% end %>                                    
            <% else %>
               <tr><td valign="center">No <%=@status%> articles.</td></tr>
            <% end%>
            </table>
        </div>
      </div>
    </div>
  </div>
</div>